<!-- #layout name=blank -->
<div class="page-header">
    <h1 class="title">Site logs</h1>
</div>
<div data-bind="component: { name: 'kb-breadcrumb', params:[{
    name: 'SITES'
},{
    name: 'DASHBOARD'
},{
    name: Kooboo.text.common.siteLogs
}]}"></div>
<div class="navbar navbar-default">
    <div class="container-fluid">
        <a class="btn green navbar-btn" data-bind="visible: selected().length, click: onBlameChanges">Undo Changes</a>
        <a class="btn green navbar-btn" data-bind="visible: selected().length == 1, click: onRestoreToPoint">Restore to Point</a>
        <a class="btn green navbar-btn" data-bind="visible: selected().length == 1, click: showCheckoutDialogClick">Checkout a website</a>
        <a class="btn green navbar-btn" data-bind="visible: selected().length == 1, click: exportIncrementPackage">Export Changes</a>
        <a class="btn green navbar-btn" data-bind="visible: selected().length == 1, click: exportItem">Export Item</a>
        <a class="btn green navbar-btn" data-bind="visible: selected().length > 1, click: exportItems">Export Items</a>
    </div>
</div>
<div data-bind="component: { name: 'kb-table', params: tableData }"></div>
<div data-bind="component: { name: 'kb-pager', params: pager }"></div>
<div data-bind="modal: showCheckoutDialog" class="modal fade" data-backdrop="static" data-keyboard="false">
    <form data-bind="submit: checkoutDialogSubmit">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-bind="click: checkoutDialogReset"><i class="fa fa-close"></i></button>
                    <h4 class="modal-title">Checkout site</h4>
                </div>
                <div class="modal-body">
                    <div class="form-horizontal">
                        <div class="form-group" id="site-name-container">
                            <label class="control-label col-md-3">Name</label>
                            <div class="col-md-9">
                                <input class="input-medium form-control" type="text" data-bind="textInput: checkoutSiteName, error: checkoutSiteName" placeholder="Site name" />
                            </div>
                        </div>
                        <div class="form-group" id="sub-domain-container">
                            <label class="col-md-3 control-label" for="SubDomain">domain</label>
                            <div class="col-md-9">
                                <div class="form-inline">
                                    <div class="form-group">
                                        <input class="input-medium form-control" data-bind="textInput: checkoutSubDomain, error: checkoutSubDomain" placeholder="Sub domain" />
                                    </div>
                                    <div class="form-group">
                                        <select class="form-control" data-bind="foreach: domains, value: checkoutRootDomain">
                                                <option data-bind="text: '.' + $data.domainName, value: $data.domainName"></option>
                                            </select>
                                    </div>
                                </div>
                                <span class="help-block">give your site a domain that other people can access.</span>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button class="btn green" type="submit">Checkout</button>
                    <button class="btn gray" data-bind="click: checkoutDialogReset">Cancel</button>
                </div>
            </div>
        </div>
    </form>
</div>
<script>
    (function() {
        Kooboo.loadJS([
            "/_Admin/Scripts/components/kbTable.js",
            "/_Admin/Scripts/components/kbPager.js",
            "/_Admin/Scripts/components/kbBreadcrumb.js",
            "/_Admin/Scripts/tableModel.js"
        ])
    })()
</script>
<script src="/_Admin/View/System/SiteLogs.js"></script>